﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy;

namespace ECommerce.Model.Order
{
    public partial class ECOrderPayInfo : EntityBase
    {
        private const string TABLE_NAME = "ECOrderPay";
        private const string INSERT_SQL = "insert into ECOrderPay ( [ID], [MemberID], [MemberLoginName], [MemberRemain], [Amount], [OrderID], [State], [Bank], [PayInterface], [Remark]) values ( @ID, @MemberID, @MemberLoginName, @MemberRemain, @Amount, @OrderID, @State, @Bank, @PayInterface, @Remark)";
        private const string UPDATE_SQL = "update ECOrderPay set  [ID] = @ID, [MemberID] = @MemberID, [MemberLoginName] = @MemberLoginName, [MemberRemain] = @MemberRemain, [Amount] = @Amount, [OrderID] = @OrderID, [State] = @State, [Bank] = @Bank, [PayInterface] = @PayInterface, [Remark] = @Remark where ID = @ID";
        /// <summary>
        /// 
        /// </summary>
        public Int64 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员ID
        /// </summary>
        public Int32 MemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员姓名
        /// </summary>
        public String MemberLoginName
        {
            get;
            set;
        }
        /// <summary>
        /// 充值前的余额
        /// </summary>
        public Double MemberRemain
        {
            get;
            set;
        }
        /// <summary>
        /// 充值数量
        /// </summary>
        public Double Amount
        {
            get;
            set;
        }
        /// <summary>
        /// 产品订单ID,如为null表示直接充值
        /// </summary>
        public Int64? OrderID
        {
            get;
            set;
        }
        /// <summary>
        /// 状态
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
        /// <summary>
        /// 支付银行
        /// </summary>
        public String Bank
        {
            get;
            set;
        }
        /// <summary>
        /// 支付接口
        /// </summary>
        public Int32 PayInterface
        {
            get;
            set;
        }
        /// <summary>
        /// 备注
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int64)value;
                    break;
                case "memberid":
                    this.MemberID = (Int32)value;
                    break;
                case "memberloginname":
                    this.MemberLoginName = (String)value;
                    break;
                case "memberremain":
                    this.MemberRemain = (Double)value;
                    break;
                case "amount":
                    this.Amount = (Double)value;
                    break;
                case "orderid":
                    this.OrderID = (Int64?)value;
                    break;
                case "state":
                    this.State = (Int32)value;
                    break;
                case "bank":
                    this.Bank = (String)value;
                    break;
                case "payinterface":
                    this.PayInterface = (Int32)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
            }
        }
    }

}
